home *** CD-ROM | disk | FTP | other *** search
/ TeX 1995 July / TeX CD-ROM July 1995 (Disc 1)(Walnut Creek)(1995).ISO / macros / eplain / doc / eplain.info-1 (.txt) < prev    next >
GNU Info File  |  1994-05-01  |  49KB  |  911 lines

  1. This is Info file eplain.info, produced by Makeinfo-1.55 from the input
  2. file eplain.texi.
  3.   This file documents the Eplain macros.
  4.   Copyright (C) 1989, 90, 91, 92, 93, 94 Karl Berry.  Steven Smith
  5. wrote the documentation for the commutative diagram macros.  (He also
  6. wrote the macros.)
  7.   Permission is granted to make and distribute verbatim copies of this
  8. manual provided the copyright notice and this permission notice are
  9. preserved on all copies.
  10.   Permission is granted to copy and distribute modified versions of this
  11. manual under the conditions for verbatim copying, provided also that the
  12. section entitled "GNU General Public License" is included exactly as in
  13. the original, and provided that the entire resulting derived work is
  14. distributed under the terms of a permission notice identical to this
  15.   Permission is granted to copy and distribute translations of this
  16. manual into another language, under the above conditions for modified
  17. versions, except that the section entitled "GNU General Public License"
  18. may be included in a translation approved by the author instead of in
  19. the original English.
  20. File: eplain.info,  Node: Top,  Next: Introduction,  Prev: (DIR),  Up: (DIR)
  21. Eplain
  22. ******
  23.   The Eplain macros provide functionality that is intended to be useful
  24. regardless of how your document is actually formatted.  This manual is
  25. for Eplain version 2.6.
  26. * Menu:
  27. * Introduction::                Eplain's purpose and philosophy.
  28. * Installation::                How to install Eplain.
  29. * Invoking Eplain::
  30. * User definitions::            Macros to be used in a document.
  31. * Arrow theoretic diagrams::    Macros for commutative diagrams.
  32. * Programming definitions::     Macros to be used in writing other macros.
  33. * Copying::
  34. * Freedom::
  35. * Macro index::                 Entries for TeX and Eplain control sequences.
  36. * Concept index::               General index.
  37.  -- The Detailed Node Listing --
  38. User definitions
  39. * Diagnostics::                 Tracing information.
  40. * Rules::                       Changing the default rule dimensions.
  41. * Citations::                   Using BibTeX and Eplain to make bibliographies.
  42. * Displays::                    Changing the formatting of math displays.
  43. * Time of day::                 Producing the time of day.
  44. * Lists::                       Producing numbered and unordered lists.
  45. * Verbatim listing::            Producing text just as it appears.
  46. * Contents::                    Making a table of contents.
  47. * Cross-references::            Symbolically referring to pages or equations.
  48. * Page references::
  49. * Justification::               Left- or right-justification, or centering.
  50. * Tables::                      Producing ordered tables.
  51. * Margins::                     Changing the margins directly.
  52. * Multiple columns::            Getting output in two columns.
  53. * Footnotes::                   Autonumbered footnotes; changing formatting.
  54. * Fractions::                   A better way to produce fractions in text.
  55. * Paths::                       Allowing line breaks in pathnames.
  56. * Logos::                       Various logos.
  57. * Boxes::                       Producing filled or open rectangles.
  58. Citations
  59. * Formatting citations::        Changing the way citations are printed.
  60. * Formatting bibliographies::   Changing the way bibliographies are printed.
  61. Displays
  62. * Formatting displays::         General formatting of displays.
  63. Lists
  64. * Formatting lists::            Changing how the lists look.
  65. Cross-references
  66. * Defining generic references::
  67. * Using generic references::
  68. Page references
  69. * Equation references::
  70. Equation references
  71. * Formatting equation references::
  72. * Subequation references::
  73. Arrow theoretic diagrams
  74. * Slanted lines and vectors::
  75. * Commutative diagrams::
  76. Commutative diagrams
  77. * Arrows and morphisms::
  78. * Construction of commutative diagrams::
  79. * Commutative diagram parameters::
  80. Programming definitions
  81. * Category codes::              Changing category codes.
  82. * Allocation macros::           Non-outer versions of \newcount et al.
  83. * Iteration::                   Doing `for' loops in TeX.
  84. * Macro arguments::             Reading and ignoring them.
  85. * Converting to characters::    Normalizing control sequences and spaces.
  86. * Expansion::                   Controlling expansion.
  87. * Obeying spaces::              Making whitespace count anywhere.
  88. * Writing out numbers::         Making `1' into `one'.
  89. * Mode-specific penalties::
  90. * Auxiliary files::             Testing for their existence.
  91. Expansion
  92. * \csn and \ece::
  93. * \edefappend::
  94. * Hooks::                       Manipulating and executing named actions.
  95. * Properties::                  Associating information with a csname.
  96. * \expandonce::
  97. * \ifundefined::
  98. * \futurenonspacelet::
  99. Regain your programming freedom
  100. * Software patents::            Algorithm monopolies.
  101. * User interface copyright::    Forbidding upward-compatibility.
  102. * What to do?::
  103. File: eplain.info,  Node: Introduction,  Next: Installation,  Prev: Top,  Up: Top
  104. Introduction
  105. ************
  106.   The "Eplain" macro package expands on and extends the definitions in
  107. plain TeX.  This manual describes the definitions that you, as either
  108. an author or a macro writer, might like to use.  It doesn't discuss the
  109. implementation; see comments in the source code (`xeplain.tex') for
  110. that.
  111.   Eplain is not intended to provide "generic typesetting capabilities,
  112. as do LaTeX (written by Leslie Lamport) or Texinfo (written by Richard
  113. Stallman and others).  Instead, it provides definitions that are
  114. intended to be useful regardless of the high-level commands that you
  115. use when you actually prepare your manuscript.
  116.   For example, Eplain does not have a command `\section', which would
  117. format section headings in an "appropriate" way, such as LaTeX's
  118. `\section'.  The philosophy of Eplain is that some people will always
  119. need or want to go beyond the macro designer's idea of "appropriate".
  120. Such canned macros are fine--as long as you are willing to accept the
  121. resulting output.  If you don't like the results, or if you are trying
  122. to match a different format, you are out of luck.
  123.   On the other hand, almost everyone would like capabilities such as
  124. cross-referencing by labels, so that you don't have to put actual page
  125. numbers in the manuscript.  The author of Eplain is not aware of any
  126. generally available macro packages that (1) do not force their
  127. typographic style on an author, and yet (2) provide such capabilities.
  128.   Besides such generic macros as cross-referencing, Eplain contains
  129. another set of definitions: ones that change the conventions of plain
  130. TeX's output.  For example, math displays in TeX are, by default,
  131. centered.  If you want your displays to come out left-justified, you
  132. have to plow through `The TeXbook' to find some way to do it, and then
  133. adapt the code to your own needs.  Eplain tries to take care of the
  134. messy details of such things, while still leaving the detailed
  135. appearance of the output up to you.
  136.   Finally, numerous definitions turned out to be useful as Eplain was
  137. developed.  They are also documented in this manual, on the chance that
  138. people writing other macros will be able to use them.
  139.   You can send bug reports or suggestions to tex-eplain@cs.umb.edu.  The
  140. current version number of Eplain is defined as the macro `\fmtversion'
  141. at the end of the source file `eplain.tex'.  When corresponding, please
  142. refer to it.
  143.   To get on this mailing list yourself, email
  144. `tex-eplain-request@cs.umb.edu' with a message whose body contains a
  145.      subscribe YOU@YOUR.PREFERRED.ADDRESS
  146. File: eplain.info,  Node: Installation,  Next: Invoking Eplain,  Prev: Introduction,  Up: Top
  147. Installation
  148. ************
  149.   The simplest way to install Eplain is simply to install the file
  150. `eplain.tex' in a directory where TeX will find it.  What that
  151. directory is obviously depends on your operating system and TeX
  152. installation.  I personally install `eplain.tex' in a directory
  153. `/usr/local/lib/texmf/tex/plain'.
  154.   If you want, you can also create a format (`.fmt') file for Eplain,
  155. which will eliminate the time spent reading the macro source file with
  156. `\input'.  You do this by issuing a sequence of Unix commands something
  157. like this:
  158.      prompt$ touch eplain.aux
  159.      prompt$ initex
  160.      This is TeX, ...
  161.      **&plain eplain
  162.      (eplain.tex)
  163.      *\dump
  164.      ... MESSAGES ...
  165. You must make sure that `eplain.aux' exists *before* you run `initex';
  166. otherwise, warning messages about undefined labels will never be issued.
  167.   You then have to install the resulting `eplain.fmt' in some system
  168. directory or set an environment variable to tell TeX how to find it.  I
  169. install the format files in `/usr/local/lib/texmf/ini'; the environment
  170. variable for the Web2C port of TeX to Unix is `TEXFORMATS'.
  171.   Some implementations of TeX (including Web2C) use the name by which
  172. TeX is invoked to determine what format to read.  For them, you should
  173. make a link to the `virtex' program named `etex', and then install the
  174. format file with the name `etex.fmt'.  This lets users invoke TeX as
  175. `etex' and get the format file read automatically, without having to
  176. say `&eplain'.
  177.   For convenience, the file `etex.tex' in the distribution directory
  178. does `\input eplain' and then `\dump', so that if you replace `eplain'
  179. with `etex' in the example above, the format file will end up with the
  180. right name.
  181.   The `install' target in the `Makefile' does all this properly for
  182. Unix systems and Web2C.  You may have to change the pathnames.
  183.   Under emtex, `eaj@acpub.duke.edu' says that
  184.      tex386 -i ^&plain eplain \dump
  185. produces a format file.
  186. File: eplain.info,  Node: Invoking Eplain,  Next: User definitions,  Prev: Installation,  Up: Top
  187. Invoking Eplain
  188. ***************
  189.   The simplest way to use Eplain is simply to put:
  190.      \input eplain
  191. at the beginning of your input file.  The macro file is small enough
  192. that reading it does not take an unbearably long time--at least on
  193. contemporary machines.
  194.   In addition, if a format (`.fmt') file has been created for Eplain
  195. (see the previous section), you can eliminate the time spent reading
  196. the macro source file.  You do this by responding `&eplain' or `&etex'
  197. to TeX's `**' prompt.  For example:
  198.      initex
  199.      This is TeX, ...
  200.      **&eplain myfile
  201.   Depending on the implementation of TeX which you are using, you might
  202. also be able to invoke TeX as `etex' and have the format file
  203. automatically read.
  204.   If you write something which you will be distributing to others, you
  205. won't know if the Eplain format will be loaded already.  If it is, then
  206. doing `\input eplain' will waste time; if it isn't, then you must load
  207. it.  To solve this, Eplain defines the control sequence `\eplain' to be
  208. the letter `t' (a convention borrowed from Lisp; it doesn't actually
  209. matter what the definition is, only that the definition exists).
  210. Therefore, you can do the following:
  211.      \ifx\eplain\undefined \input eplain \fi
  212.    where `\undefined' must never acquire a definition.
  213. Eplain consists of several source files:
  214. `xeplain.tex'
  215.      most of the macros;
  216. `arrow.tex'
  217.      commutative diagram macros, *note Arrow theoretic diagrams::.
  218.      (written by Steven Smith);
  219. `btxmac.tex'
  220.      bibliography-related macros, *note Citations::.;
  221. `texnames.sty'
  222.      abbreviations for various TeX-related names, *note Logos::.
  223.      (edited by Nelson Beebe).
  224. The file `eplain.tex' is all of these files merged together, with
  225. comments removed.
  226.   All of these files except `xeplain.tex' can be input individually, if
  227. all you want are the definitions in that file.
  228.   Also, since the bibliography macros are fairly extensive, you might
  229. not want to load them, to conserve TeX's memory.  Therefore, if the
  230. control sequence `\nobibtex' is defined, then the bibliography
  231. definitions are skipped.  You must set `\nobibtex' before `eplain.tex'
  232. is read, naturally.  For example, you could start your input file like
  233. this:
  234.      \let\nobibtex = t
  235.      \input eplain
  236.   By default, `\nobibtex' is undefined, and so the bibliography
  237. definitions *are* made.
  238.   Likewise, define `\noarrow' if you don't want to include the
  239. commutative diagram macros from `arrow.tex', perhaps because you
  240. already have conflicting ones.
  241.   If you don't want to read or write an `aux' file at all, for any kind
  242. of cross-referencing, define `\noauxfile' before reading `eplain.tex'.
  243. This also turns off all warnings about undefined labels.
  244.   Eplain conflicts with AMSTeX (more precisely, with `amsppt.sty') The
  245. macros `\cite' and `\ref' are defined by both.
  246.   If you want to use AMSTeX's `\cite', the solution is to define
  247. `\nobibtex' before reading Eplain, as described above.
  248.   If you have `amsppt.sty' loaded and use `\ref', Eplain writes a
  249. warning on your terminal. If you want to use the AMSTeX `\ref', do
  250. `\let\ref = \amsref' after reading Eplain.  To avoid the warning, do
  251. `\let\ref = \eplainref' after reading Eplain and before using `\ref'.
  252. File: eplain.info,  Node: User definitions,  Next: Arrow theoretic diagrams,  Prev: Invoking Eplain,  Up: Top
  253. User definitions
  254. ****************
  255.   This chapter describes definitions that are meant to be used directly
  256. in a document.  When appropriate, ways to change the default formatting
  257. are described in subsections.
  258. * Menu:
  259. * Diagnostics::          Tracing information.
  260. * Rules::                Changing the default rule dimensions.
  261. * Citations::            Using BibTeX and Eplain to make bibliographies.
  262. * Displays::             Changing the formatting of math displays.
  263. * Time of day::          Producing the time of day.
  264. * Lists::                Producing numbered and unordered lists.
  265. * Verbatim listing::     Producing text just as it appears.
  266. * Contents::             Making a table of contents.
  267. * Cross-references::     Symbolic references to equations, figures, etc.
  268. * Page references::      Symbolic references to page numbers.
  269. * Indexing::         Creating and typesetting indexes.
  270. * Justification::        Left- or right-justification by lines, or centering.
  271. * Tables::               Producing ordered tables.
  272. * Margins::              Changing the margins directly.
  273. * Multiple columns::     Getting output in two columns.
  274. * Footnotes::            Autonumbered footnotes; changing formatting.
  275. * Fractions::            A better way to produce fractions in text.
  276. * Paths::                Allowing line breaks in pathnames.
  277. * Logos::                Various logos.
  278. * Boxes::                Producing filled or open rectangles.
  279. File: eplain.info,  Node: Diagnostics,  Next: Rules,  Up: User definitions
  280. Diagnostics
  281. ===========
  282.   Plain TeX provides the `\tracingall' command, to turn on the maximum
  283. amount of tracing possible in TeX.  The (usually voluminous) output
  284. from `\tracingall' goes both on the terminal and into the transcript
  285. file.  It is sometimes easier to have the output go only to the
  286. transcript file, so you can peruse it at your leisure and not obscure
  287. other output to the terminal.  So, Eplain provides the command
  288. `\loggingall'.  (For some reason, this command is available in
  289. Metafont, but not in TeX.)
  290.   It is also sometimes useful to see the complete contents of boxes.
  291. `\tracingboxes' does this.  (It doesn't affect whether or not the
  292. contents are shown on the terminal.)
  293.   You can turn off all tracing with `\tracingoff'.
  294.   You can also turn logging on and off globally, so you don't have to
  295. worry about whether or not you're inside a group at the time of command.
  296. These variants are named `\gloggingall' and `\gtracingall'.
  297.   Finally, if you write your own help messages (see `\newhelp' in `The
  298. TeXbook'), you want a convenient way to break lines in them.  This is
  299. what TeX's `\newlinechar' parameter is for; however, plain TeX doesn't
  300. set `\newlinechar'.  Therefore, Eplain defines it to be the character
  301. `^^J'.
  302.   For example, one of Eplain's own error messages is defined as follows:
  303.      \newhelp\envhelp{Perhaps you forgot to end the previous^^J%
  304.         environment? I'm finishing off the current group,^^J%
  305.         hoping that will fix it.}%
  306. File: eplain.info,  Node: Rules,  Next: Citations,  Prev: Diagnostics,  Up: User definitions
  307. Rules
  308. =====
  309.   The default dimensions of rules are defined in chapter 21 of the `The
  310. TeXbook'.  To sum up what is given there, the "thickness" of rules is
  311. 0.4pt by default.  Eplain defines three parameters that let you change
  312. this dimension: `\hruledefaultheight', `\hruledefaultdepth', and
  313. `\vruledefaultwidth'.  By default, they are defined as `The TeXbook'
  314. describes.
  315.   But it would be wrong to redefine `\hrule' and `\vrule'.  For one
  316. thing, some macros in plain TeX depend on the default dimensions being
  317. used; for another, rules are used quite heavily, and the performance
  318. impact of making it a macro can be noticeable.  Therefore, to take
  319. advantage of the default rule parameters, you must use `\ehrule' and
  320. `\evrule'.
  321. File: eplain.info,  Node: Citations,  Next: Displays,  Prev: Rules,  Up: User definitions
  322. Citations
  323. =========
  324.   Bibliographies are part of almost every technical document.  To handle
  325. them easily, you need two things: a program to do the tedious
  326. formatting, and a way to cite references by labels, rather than by
  327. numbers.  The BibTeX program, written by Oren Patashnik, takes care of
  328. the first item; the citation commands in LaTeX, written to be used with
  329. BibTeX, take care of the second.  Therefore, Eplain adopts the use of
  330. BibTeX, and virtually the same interface as LaTeX.
  331.   The general idea is that you put citation commands in the text of your
  332. document, and commands saying where the bibliography data is.  When you
  333. run TeX, these commands produce output on the file with the same root
  334. name as your document (by default) and the extension `.aux'.  BibTeX
  335. reads this file.  You should put the bibliography data in a file or
  336. files with the extension `.bib'. BibTeX writes out a file with the same
  337. root name as your document and extension `.bbl'.  Eplain reads this file
  338. the next time you run your document through TeX.  (It takes multiple
  339. passes to get everything straight, because usually after seeing your
  340. bibliography typeset, you want to make changes in the `.bib' file,
  341. which means you have to run BibTeX again, which means you have to run
  342. TeX again...)  An annotated example of the whole process is given below.
  343.   If your document has more than one bibliography--for example, if it
  344. is a collection of papers--you can tell Eplain to use a different root
  345. name for the `.bbl' file by defining the control sequence
  346. `\bblfilebasename'.  The default definition is simply `\jobname'.
  347.   See the document `BibTeXing' (whose text is in the file `btxdoc.tex',
  348. which should be in the Eplain distribution you got) for information on
  349. how to write your .bib files.  Both the BibTeX and the Eplain
  350. distributions contain several examples, also.
  351.   The `\cite' command produces a citation in the text of your document.
  352. The exact printed form the citation will take is under your control;
  353. *note Formatting citations::..  `\cite' takes one required argument, a
  354. comma-separated list of cross-reference labels (*note
  355. Cross-references::., for exactly what characters are allowed in such
  356. labels).  Warning: spaces in this list are taken as part of the
  357. following label name, which is probably not what you expect.  The
  358. `\cite' command also produces a command in the .aux file that tells
  359. BibTeX to retrieve the given reference(s) from the .bib file.  `\cite'
  360. also takes one optional argument, which you specify within square
  361. brackets, as in LaTeX.  This text is simply typeset after the
  362. citations.  (See the example below.)
  363.   Another command, `\nocite', puts the given reference(s) into the
  364. bibliography, but produces nothing in the text.
  365.   The `\bibliography' command is next.  It serves two purposes:
  366. producing the typeset bibliography, and telling BibTeX the root names
  367. of the .bib files.  Therefore, the argument to `\bibliography' is a
  368. comma separated list of the .bib files (without the `.bib').  Again,
  369. spaces in this list are significant.
  370.   You tell BibTeX the particular style in which you want your
  371. bibliography typeset with one more command: `\bibliographystyle'.  The
  372. argument to this is a single filename STYLE, which tells BibTeX to look
  373. for a file STYLE.bst.  See the document `Designing BibTeX styles'
  374. (whose text is in the `btxhak.tex') for information on how to write
  375. your own styles.
  376.   Eplain automatically reads the citations from the .aux file when your
  377. job starts.
  378.   If you don't want to see the messages about undefined citations, you
  379. can say `\xrefwarningfalse' before making any citations.  Eplain
  380. automatically does this if the .aux file does not exist.  You can
  381. restore the default by saying `\xrefwarningtrue'.
  382.   Here is a TeX input file that illustrates the various commands.
  383.      \input eplain                    % Reads the .aux file.
  384.      Two citations to Knuthian works:
  385.        \cite[note]{surreal,concrete-math}.
  386.      \beginsection{References.}\par   % Title for the bibliography.
  387.      \bibliography{knuth}             % Use knuth.bib for the labels.
  388.      \bibliographystyle{plain}        % Number the references.
  389.      \end                             % End of the document.
  390.   If we suppose that this file was named `citex.tex' and that the
  391. bibliography data is in `knuth.bib' (as the `\bibliography' command
  392. says), the following commands do what's required.  (`$ ' represents the
  393. shell prompt.)
  394.      $ tex citex       (produces undefined citation messages)
  395.      $ bibtex citex    (read knuth.bib and citex.aux, write citex.bbl)
  396.      $ tex citex       (read citex.bbl, still have undefined citations)
  397.      $ tex citex       (one more time, to resolve the references)
  398.   The output looks something like (because we used the plain
  399. bibliography style):
  400.      Two citations to Knuthian works: [2,1 note].
  401.      References
  402.      [1] Ronald L. Graham, Donald E. Knuth, and Oren Patashnik.
  403.      Concrete Mathematics. Addison-Wesley, Reading, Massachusetts, 1989.
  404.      [2] Donald E. Knuth. Surreal Numbers. Addison-Wesley, Reading,
  405.      Massachusetts, 1974.
  406.   See the BibTeX documentation for information on how to write the
  407. bibliography databases, and the bibliography styles that are available.
  408. (If you want your references printed with names, as in [Knu74], instead
  409. of numbered, the bibliography style is `alpha'.)
  410. * Menu:
  411. * Formatting citations::        Changing the way citations are printed.
  412. * Formatting bibliographies::   Changing the way bibliographies are printed.
  413. File: eplain.info,  Node: Formatting citations,  Next: Formatting bibliographies,  Up: Citations
  414. Formatting citations
  415. --------------------
  416.   You may wish to change Eplain's formatting of citations; i.e., the
  417. result of your `\cite' commands.  By default, the citation labels are
  418. printed one after another, separated by commas and enclosed in
  419. brackets, using the main text font.  Some formats require other styles,
  420. such as superscripted labels.  You can accomodate such formats by
  421. redefining the following macros.
  422. `\printcitestart'
  423. `\printcitefinish'
  424.      Eplain expands these macros at the begining and end of the list of
  425.      citations for each `\cite' command.  By default, they produce a
  426.      `[' and `]', respectively.
  427. `\printbetweencitations'
  428.      If a `\cite' command has multiple citations, as in
  429.      `\cite{acp,texbook}', Eplain expands this macro in between each
  430.      pair of citations.  By default, it produces a comma followed by a
  431.      space.
  432. `\printcitenote'
  433.      This macro takes one argument, which is the optional note to the
  434.      `\cite' command.  If the `\cite' command had no note, this macro
  435.      isn't used.  Otherwise, it should print the note.  By default, the
  436.      note is preceded with a comma and a space.
  437.   Here is an example, showing you could produce citations as
  438. superscripted labels, with the optional notes in parentheses.
  439.      \def\printcitestart{\unskip $^\bgroup}
  440.      \def\printbetweencitations{,}
  441.      \def\printcitefinish{\egroup$}
  442.      \def\printcitenote#1{\hbox{\sevenrm\space (#1)}}
  443. File: eplain.info,  Node: Formatting bibliographies,  Prev: Formatting citations,  Up: Citations
  444. Formatting bibliographies
  445. -------------------------
  446.   You may wish to change Eplain's formatting of the bibliography,
  447. especially with respect to the fonts that are used.  Therefore, Eplain
  448. provides the following control sequences:
  449. `\biblabelwidth'
  450.      This control sequence represents a `\dimen' register, and its value
  451.      is the width of the widest label in the bibliography.  Although it
  452.      is unlikely you will ever want to redefine it, you might want to
  453.      use it if you redefine `\biblabelprint', below.
  454. `\biblabelprint'
  455.      This macro takes one argument, the label to print.  By default, the
  456.      label is put in a box of width `\biblabelwidth', and is followed by
  457.      an enspace.  When you want to change the spacing around the
  458.      labels, this is the right macro to redefine.
  459. `\biblabelcontents'
  460.      This macro also takes one argument, the label to print.  By
  461.      default, the label is printed using the font `\bblrm' (below), and
  462.      enclosed in brackets.  When you want to change the appearance of
  463.      the label, but not the spacing around it, this is the right macro
  464.      to redefine.
  465. `\bblrm'
  466.      The default font used for printing the bibliography.
  467. `\bblem'
  468.      The font used for printing the titles and other "emphasized"
  469.      material.
  470. `\bblsc'
  471.      In some styles, authors' names are printed in a caps-and-small-caps
  472.      font.  In those cases, this font is used.
  473. `\bblnewblock'
  474.      This is invoked between each of the parts of a bibliography entry.
  475.      The default is to leave some extra space between the parts; you
  476.      could redefine it to start each part on a new line (for example).
  477.      A part is simply a main element of the entry; for example, the
  478.      author is a part.  (It was LaTeX that introduced the (misleading,
  479.      as far as I am concerned) term `block' for this.)
  480. `\biblabelextraspace'
  481.      Bibliography entries are typeset with a hanging indentation of
  482.      `\biblabelwidth' plus this.  The default is `.5em', where the em
  483.      width is taken from the `\bblrm' font.  If you want to change
  484.      this, you should do it inside `\bblhook'.
  485. `\bblhook'
  486.      This is expanded before reading the .bbl file.  By default, it
  487.      does nothing.  You could, for example, define it to set the
  488.      bibliography fonts, or produce the heading for the references.  Two
  489.      spacing parameters must be changed inside `\bblhook': `\parskip',
  490.      which produces extra space between the items; and
  491.      `\biblabelextraspace', which is described above.  (By the way,
  492.      `\hookappend' won't work with `\bblhook', despite the names. Just
  493.      use `\def'.)
  494.   If you are really desperate, you can also hand-edit the .bbl file
  495. that BibTeX produces to do anything you wish.
  496. File: eplain.info,  Node: Displays,  Next: Time of day,  Prev: Citations,  Up: User definitions
  497. Displays
  498. ========
  499.   By default, TeX centers displayed material.  (Displayed material is
  500. just whatever you put between `$$''s--it's not necessarily
  501. mathematics.)  Many layouts would be better served if the displayed
  502. material was left-justified.  Therefore, Eplain provides the command
  503. `\leftdisplays', which indents displayed material by `\parindent' plus
  504. `\leftskip', plus `\leftdisplayindent'.
  505.   You can go back to centering displays with `\centereddisplays'.  (It
  506. is usually poor typography to have both centered and left-justified
  507. displays in a single publication, though.)
  508.   `\leftdisplays' also changes the plain TeX commands that deal with
  509. alignments inside math displays, `\displaylines', `\eqalignno', and
  510. `\leqalignno', to produce left-justified text.  You can still override
  511. this formatting by inserting `\hfill' glue, as explained in `The
  512. TeXbook'.
  513. * Menu:
  514. * Formatting displays::         General formatting of displays.
  515. File: eplain.info,  Node: Formatting displays,  Up: Displays
  516. Formatting displays
  517. -------------------
  518.   If you want some other kind of formatting, you can write a definition
  519. of your own, analogous to `\leftdisplays'.  You need only make sure
  520. that `\leftdisplaysetup' is called at the beginning of every display
  521. (presumably by invoking it in TeX's `\everydisplay' parameter), and to
  522. define `\generaldisplay'.
  523.   `\leftdisplays' expands the old value of `\everydisplay' before
  524. calling `\leftdisplaysetup', so that any changes you have made to it
  525. won't be lost.  That old token list as available as the value of the
  526. token register `\previouseverydisplay'.
  527. File: eplain.info,  Node: Time of day,  Next: Lists,  Prev: Displays,  Up: User definitions
  528. Time of day
  529. ===========
  530.   TeX provides the day, month, and year as numeric quantities (unless
  531. your TeX implementation is woefully deficient).  Eplain provides some
  532. control sequences to make them a little more friendly to humans.
  533.   `\monthname' produces the name of the current month, abbreviated to
  534. three letters.
  535.   `\fullmonthname' produces the name of the current month,
  536. unabbreviated (in English).
  537.   `\timestring' produces the current time, as in `1:14 p.m.'
  538.   `\timestamp' produces the current date and time, as in `23 Apr 64
  539. 1:14 p.m.'.  (Except the spacing is slightly different.)
  540.   `\today' produces the current date, as in `23 April 1964'.
  541. File: eplain.info,  Node: Lists,  Next: Verbatim listing,  Prev: Time of day,  Up: User definitions
  542. Lists
  543. =====
  544.   Many documents require lists of items, either numbered or simply
  545. enumerated.  Plain TeX defines one macro to help with creating lists,
  546. `\item', but that is insufficient in many cases.  Therefore, Eplain
  547. provides two pairs of commands:
  548. `\numberedlist ... \endnumberedlist'
  549. `\orderedlist ... \endorderedlist'
  550.      These commands (they are synonyms) produce a list with the items
  551.      numbered sequentially, starting from one.  A nested `\numberedlist'
  552.      labels the items with lowercase letters, starting with `a'.
  553.      Another nested `\numberedlist' labels the items with roman
  554.      numerals.  Yet more deeply nested numbered lists label items with
  555.      `*'.
  556. `\unorderedlist ... \endunorderedlist'
  557.      This produces a list with the items labelled with small black boxes
  558.      ("square bullets"). A nested `\unorderedlist' labels items with
  559.      em-dashes.  Doubly (and deeper) nested unordered lists label items
  560.      with `*'s.
  561.   The two kinds of lists can be nested within each other, as well.
  562.   In both kinds of lists, you begin an item with `\li'.  An item may
  563. continue for several paragraphs.  Each item starts a paragraph.
  564.   You can give `\li' an optional argument, a cross-reference label.
  565. It's defined to be the "marker" for the current item.  This is useful
  566. if the list items are numbered.  You can produce the value of the label
  567. with `\xrefn'.  *Note Cross-references::.
  568.   You can also say `\listcompact' right after `\numberedlist' or
  569. `\unorderedlist'.  The items in the list will then not have any extra
  570. space between them (*note Formatting lists::.).  You might want to do
  571. this if the items in this particular list are short.
  572.   Here is an example:
  573.      \numberedlist\listcompact
  574.      \li The first item.
  575.      \li The second item.
  576.      
  577.      The second paragraph of the second item.
  578.      \endnumberedlist
  579. * Menu:
  580. * Formatting lists::            Changing how the lists look.
  581. File: eplain.info,  Node: Formatting lists,  Up: Lists
  582. Formatting lists
  583. ----------------
  584.   Several registers define the spacing associated with lists.  It is
  585. likely that their default values won't suit your particular layout.
  586. `\abovelistskipamount, \belowlistskipamount'
  587.      The vertical glue inserted before and after every list,
  588.      respectively.
  589. `\interitemskipamount'
  590.      The vertical glue inserted before each item except the first.
  591.      `\listcompact' resets this to zero, as mentioned above.
  592. `\listleftindent, \listrightindent'
  593.      `\listrightindent' is the amount of space by which the list is
  594.      indented on the right; i.e., it is added to `\rightskip'.
  595.      `\listleftindent' is the amount of space, *relative to*
  596.      `\parindent', by which the list is indented on the left.  Why treat
  597.      the two parameters differently?  Because (a) it is more useful to
  598.      make the list indentation depend on the paragraph indentation;
  599.      (b) footnotes aren't formatted right if `\parindent' is reset to
  600.      zero.
  601.   The three vertical glues are inserted by macros, and preceded by
  602. penalties: `\abovelistskip' does `\vpenalty\abovelistpenalty' and then
  603. `\vskip\abovelistskip'.  `\belowlistskip' and `\interitemskip' are
  604. analogous.
  605.   In addition, the macro `\listmarkerspace' is called to separate the
  606. item label from the item text.  This is set to `\enspace' by default.
  607.   If you want to change the labels on the items, you can redefine these
  608. macros: `\numberedmarker' or `\unorderedmarker'.  The following
  609. registers might be useful if you do:
  610. `\numberedlistdepth, \unorderedlistdepth'
  611.      These keep track of the depth of nesting of the two kinds of lists.
  612. `\itemnumber, \itemletter'
  613.      These keep track of the number of items that have been seen in the
  614.      current numbered list.  They are both integer registers.  The
  615.      difference is that `\itemnumber' starts at one, and `\itemletter'
  616.      starts at 97, i.e., lowercase `a'.
  617.   You can also redefine the control sequences that are used internally,
  618. if you want to do something radically different:  `\beginlist' is
  619. invoked to begin both kinds of lists; `\printitem' is invoked to print
  620. the label (and space following the label) for each item; and `\endlist'
  621. is invoked to end both kinds of lists.
  622. File: eplain.info,  Node: Verbatim listing,  Next: Contents,  Prev: Lists,  Up: User definitions
  623. Verbatim listing
  624. ================
  625.   It is sometimes useful to include a file verbatim in your document;
  626. for example, part of a computer program.  The `\listing' command is
  627. given one argument, a filename, and produces the contents of that file
  628. in your document.  `\listing' expands `\listingfont' to set the current
  629. font.  The default value of `\listingfont' is `\tt'.
  630.   You can take arbitrary actions before reading the file by defining
  631. the macro `\setuplistinghook'.  This is expanded just before the file
  632. is input.
  633.   If you want to have line numbers on the output, you can say
  634. `\let\setuplistinghook = \linenumberedlisting'.  The line numbers are
  635. stored in the count register `\lineno' while the file is being read.
  636. You can redefine the macro `\printlistinglineno' to change how they are
  637. printed.
  638.   You can produce in-line verbatim text in your document with
  639. `\verbatim'.  End the text with `|endverbatim'.  If you need a `|' in
  640. the text, double it.  If the first character of the verbatim text is a
  641. space, use `| '. (`| ' will work elsewhere in the argument, too, but
  642. isn't necessary.)
  643.   For example:
  644.        \verbatim| ||\#%&!|endverbatim
  645. produces ` |\#%&!'.
  646.   Line breaks and spaces in the verbatim text are preserved.
  647.   You can change the verbatim escape character from the default `|'
  648. with `\verbatimescapechar CHAR'; for example, this changes it to `@'.
  649.      \verbatimescapechar \@
  650. The backslash is not necessary in some cases, but is in others,
  651. depending on the catcode of the character.  The argument to
  652. `\verbatimescapechar' is used as `\catcode `CHAR', so the exact rules
  653. follow that for `\catcode'.
  654.   Because `\verbatim' must change the category code of special
  655. characters, calling inside a macro definition of your own does not work
  656. properly.  For example:
  657.      \def\mymacro{\verbatim &#%|endverbatim}% Doesn't work!
  658.   To accomplish this, you must change the category codes yourself before
  659. making the macro definition.  Perhaps `\uncatcodespecials' will help
  660. you (*note Category codes::.).
  661. File: eplain.info,  Node: Contents,  Next: Cross-references,  Prev: Verbatim listing,  Up: User definitions
  662. Contents
  663. ========
  664.   Producing a table of contents that is both useful and aesthetic is one
  665. of the most difficult design problems in any work.  Naturally, Eplain
  666. does not pretend to solve the design problem.  Collecting the raw data
  667. for a table of contents, however, is much the same across documents.
  668. Eplain uses an auxiliary file with extension `.toc' (and the same root
  669. name as your document) to save the information.
  670.   To write an entry for the table of contents, you say
  671. `\writetocentry{PART}{TEXT}', where PART is the type of part this entry
  672. is, e.g., `chapter', and TEXT is the text of the title.
  673. `\writetocentry' puts an entry into the .toc file that looks like
  674. `\tocPARTentry{TEXT}{PAGE NUMBER}'.  The TEXT is written unexpanded.
  675.   A related command, `\writenumberedtocentry', takes one additional
  676. argument, the first token of which is expanded at the point of the
  677. `\writenumberedtocentry', but the rest of the argument is not expanded.
  678. The usual application is when the parts of the document are numbered.
  679. On the other hand, the one-level expansion allows you to use the
  680. argument for other things as well (author's names in a proceedings,
  681. say), and not have accents or other control sequences expanded.  The
  682. downside is that if you *want* full expansion of the third argument,
  683. you don't get it--you must expand it yourself, before you call
  684. `\writenumberedtocentry'.
  685.   For example:
  686.      \writenumberedtocentry{chapter}{A $\sin$ wave}{\the\chapno}
  687.      \writetocentry{section}{A section title}
  688. Supposing `\the\chapno' expanded to `3' and that the `\write''s
  689. occurred on pages eight and nine, respectively, the above writes the
  690. following to the .toc file:
  691.      \tocchapterentry{A $\sin$ wave}{3}{8}
  692.      \tocsectionentry{A section title}{9}
  693.   You read the .toc file with the command `\readtocfile'.  Naturally,
  694. whatever `\toc... entry' commands that were written to the file must be
  695. defined when `\readtocfile' is invoked.  Eplain has minimal definitions
  696. for `\tocchapterentry', `\tocsectionentry', and `\tocsubsectionentry',
  697. just to prevent undefined control sequence errors in common cases.
  698. They aren't suitable for anything but preliminary proofs.
  699.   After reading the .toc file, `\readtocfile' opens the file for
  700. writing, thereby deleting the information from the previous run.  You
  701. should therefore arrange that `\readtocfile' be called *before* the
  702. first call to a `\writetoc...' macro.  On the other hand, if you don't
  703. want to rewrite the .toc file, perhaps because you are only running TeX
  704. on part of your manuscript, you can set `\rewritetocfilefalse'.
  705.   By default, the `.toc' file has the root `\jobname'.  If your
  706. document has more than one contents--for example, if it is a collection
  707. of papers, some of which have their own contents--you can tell Eplain
  708. to use a different root name by defining the control sequence
  709. `\tocfilebasename'.
  710.   In addition to the usual table of contents, you may want to have a
  711. list of figures, list of tables, or other such contents-like list. You
  712. can do this with `\definecontentsfile{ABBREV}'.  All of the above
  713. commands are actually a special case that Eplain predefines with
  714.      \definecontentsfile{toc}
  715. The ABBREV is used both for the file extension and in the control
  716. sequence names.
  717. File: eplain.info,  Node: Cross-references,  Next: Page references,  Prev: Contents,  Up: User definitions
  718. Cross-references
  719. ================
  720.   It is often useful to refer the reader to other parts of your
  721. document; but putting literal page, section, equation, or whatever
  722. numbers in the text is certainly a bad thing.
  723.   Eplain therefore provides commands for symbolic cross-references.  It
  724. uses an auxiliary file with extension .aux (and the same root name as
  725. your document) to keep track of the information.  Therefore, it takes
  726. two passes to get the cross-references right--one to write them out,
  727. and one to read them in.  Eplain automatically reads the .aux file at
  728. the first reference; after reading it, Eplain reopens it for writing.
  729.   You can control whether or not Eplain warns you about undefined
  730. labels.  *Note Citations::.
  731.   Labels in Eplain's cross-reference commands can use characters of
  732. category code eleven (letter), twelve (other), ten (space), three (math
  733. shift), four (alignment tab), seven (superscript), or eight (subscript).
  734. For example, `(a1 $&^_' is a valid label (assuming the category codes
  735. of plain TeX), but `%#\{' has no valid characters.
  736.   You can also do symbolic cross-references for bibliographic citations
  737. and list items.  *Note Citations::, and *Note Lists::.
  738. * Menu:
  739. * Defining generic references::
  740. * Using generic references::
  741. File: eplain.info,  Node: Defining generic references,  Next: Using generic references,  Up: Cross-references
  742. Defining generic references
  743. ---------------------------
  744.   Eplain provides the command `\definexref' for general
  745. cross-references.  It takes three arguments: the name of the label (see
  746. section above for valid label names), the value of the label (which can
  747. be anything), and the "class" of the reference--whether it's a section,
  748. or theorem, or what.  For example:
  749.      \definexref{sec-intro}{3.1}{section}
  750. Of course, the label value is usually generated by another macro using
  751. TeX count registers or some such.
  752.   `\definexref' doesn't actually define LABEL; instead, it writes out
  753. the definition to the .aux file, where Eplain will read it on the next
  754. TeX run.
  755.   The CLASS argument is used by the `\ref' and `\refs' commands.  See
  756. the next section.
  757. File: eplain.info,  Node: Using generic references,  Prev: Defining generic references,  Up: Cross-references
  758. Using generic references
  759. ------------------------
  760.   To retrieve the value of the label defined via `\definexref' (see the
  761. previous section), Eplain provides the following macros:
  762. `\refn{LABEL}'
  763. `\xrefn{LABEL}'
  764.      `\refn' and `\xrefn' (they are synonyms) produce the bare
  765.      definition of LABEL.  If LABEL isn't defined, issue a warning, and
  766.      produce LABEL itself instead, in typewriter.  (The warning isn't
  767.      given if `\xrefwarningfalse'.)
  768. `\ref{LABEL}'
  769.      Given the class C for LABEL (see the description of `\definexref'
  770.      in the previous section), expand the control sequence `\C word'
  771.      (if it's defined) followed by a tie.  Then call `\refn' on LABEL.
  772.      (Example below.)
  773. `\refs{LABEL}'
  774.      Like `\ref', but append the letter `s' to the `\...word'.
  775.   The purpose of the `\...word' macro is to produce the word `Section'
  776. or `Figure' or whatever that usually precedes the actual reference
  777. number.
  778.   Here is an example:
  779.      \def\sectionword{Section}
  780.      \definexref{sec-intro}{3.1}{section}
  781.      \definexref{sec-next}{3.2}{section}
  782.      See \refs{sec-intro} and \refn{sec-next} ...
  783. This produces `See Sections 3.1 and 3.2 ...'
  784. File: eplain.info,  Node: Page references,  Next: Indexing,  Prev: Cross-references,  Up: User definitions
  785. Page references
  786. ===============
  787.   Eplain provides two commands for handling references to page numbers,
  788. one for definition and one for use.
  789. `\xrdef{LABEL}'
  790.      Define LABEL to be the current page number.  This produces no
  791.      printed output, and ignores following spaces.
  792. `\xref{LABEL}'
  793.      Produce the text `p. PAGE-NUMBER', which is the usual form for
  794.      cross-references.  The PAGE-NUMBER is actually LABEL's definition;
  795.      if LABEL isn't defined, the text of the label itself is printed.
  796. * Menu:
  797. * Equation references::
  798. File: eplain.info,  Node: Equation references,  Up: Page references
  799. Equation references
  800. -------------------
  801.   Instead of referring to pages, it's most useful if equation labels
  802. refer to equation numbers.  Therefore, Eplain reserves a `\count'
  803. register, `\eqnumber', for the current equation number, and increments
  804. it at each numbered equation.
  805.   Here are the commands to define equation labels and then refer to
  806. them:
  807. `\eqdef{LABEL}'
  808.      This defines LABEL to be the current value of `\eqnumber', and, if
  809.      the current context is not inner, then produces a `\eqno' command.
  810.      (The condition makes it possible to use `\eqdef' in an
  811.      `\eqalignno' construction, for example.)  The text of the equation
  812.      number is produced using `\eqprint'.  *Note Formatting equation
  813.      references::.
  814.      If LABEL is empty, you still get an equation number (although
  815.      naturally you can't reliably refer to it).  This is useful if you
  816.      want to put numbers on all equations in your document, and you
  817.      don't want to think up unique labels.
  818. `\eqdefn{LABEL}'
  819.      This is like `\eqdef', except it always omits the `\eqno' command.
  820.      It can therefore be used in places where `\eqdef' can't; for
  821.      example, in a non-displayed equation.  The text of the equation
  822.      number is not produced, so you can also use it in the (admittedly
  823.      unusual) circumstance when you want to define an equation label
  824.      but not print that label.
  825. `\eqref{LABEL}'
  826.      This produces a formatted reference to LABEL.  If LABEL is
  827.      undefined (perhaps because it is a forward reference), it just
  828.      produces the text of the label itself.  Otherwise, it calls
  829.      `\eqprint'.
  830. `\eqrefn{LABEL}'
  831.      This produces the cross-reference text for LABEL.  That is, it is
  832.      like `\eqref', except it doesn't call `\eqprint'.
  833.   Equation labels can contain the same characters that are valid in
  834. general cross-references.
  835. * Menu:
  836. * Formatting equation references::
  837. * Subequation references::
  838. File: eplain.info,  Node: Formatting equation references,  Next: Subequation references,  Up: Equation references
  839. Formatting equation references
  840. ..............................
  841.   Both defining an equation label and referring to it should usually
  842. produce output.  This output is produced with the `\eqprint' macro,
  843. which takes one argument, the equation number being defined or referred
  844. to.  By default, this just produces `(NUMBER)', where NUMBER is the
  845. equation number.  To produce the equation number in a different font,
  846. or with different surrounding symbols, or whatever, you can redefine
  847. `\eqprint'.  For example, the following definition would print all
  848. equation numbers in italics.  (The extra braces define a group, to keep
  849. the font change from affecting surrounding text.)
  850.      \def\eqprint#1{{\it (#1)}}
  851.   In addition to changing the formatting of equation numbers, you might
  852. to add more structure to the equation number; for example, you might
  853. want to include the chapter number, to get equation numbers like
  854. `(1.2)'.  To achieve this, you redefine `\eqconstruct'.  For example:
  855.      \def\eqconstruct#1{\the\chapternumber.#1}
  856. (If you are keeping the chapter number in a count register named
  857. `\chapternumber', naturally.)
  858.   The reason for having both `\eqconstruct' and `\eqprint' may not be
  859. immediately apparent.  The difference is that `\eqconstruct' affects
  860. the text that cross-reference label is defined to be, while `\eqprint'
  861. affects only what is typeset on the page.  The example just below might
  862. help.
  863.   Usually, you want equation labels to refer to equation numbers.  But
  864. sometimes you might want a more complicated text.  For example, you
  865. might have an equation `(1)', and then have a variation several pages
  866. later which you want to refer to as `(1*)'.
  867.   Therefore, Eplain allows you to give an optional argument (i.e.,
  868. arbitrary text in square brackets) before the cross-reference label to
  869. \eqdef.  Then, when you refer to the equation, that text is produced.
  870. Here's how to get the example just mentioned:
  871.      $$...\eqdef{a-eq}$$
  872.      ...
  873.      $$...\eqdef[\eqrefn{a-eq}*]{a-eq-var}$$
  874.      In \eqref{a-eq-var}, we expand on \eqref{a-eq}, ...
  875.   We use `\eqrefn' in the cross-reference text, not `\eqref', so that
  876. `\eqprint' is called only once.
  877. File: eplain.info,  Node: Subequation references,  Prev: Formatting equation references,  Up: Equation references
  878. Subequation references
  879. ......................
  880.   Eplain also provides for one level of substructure for equations.
  881. That is, you might want to define a related group of equations with
  882. numbers like `2.1' and `2.2', and then be able to refer to the group as
  883. a whole: "... in the system of equations (2)...".
  884.   The commands to do this are `\eqsubdef' and `\eqsubdefn'.  They take
  885. one LABEL argument like their counterparts above, and generally behave
  886. in the same way.  The difference is in how they construct the equation
  887. number: instead of using just `\eqnumber', they also use another
  888. counter, `\subeqnumber'.  This counter is advanced by one at every
  889. `\eqsubdef' or `\eqsubdefn', and reset to zero at every `\eqdef' or
  890. `\eqdefn'.
  891.   You use `\eqref' to refer to subequations as well as main equations.
  892.   To put the two together to construct the text that the label will
  893. produce, they use a macro `\eqsubreftext'.  This macros takes two
  894. arguments, the "main" equation number (which, because the equation
  895. label can be defined as arbitrary text, as described in the previous
  896. section, might be anything at all) and the "sub" equation number (which
  897. is always just a number).  Eplain's default definition just puts a
  898. period between them:
  899.        \def\eqsubreftext#1#2{#1.#2}%
  900. You can redefine `\eqsubreftext' to print however you like.  For
  901. example, this definition makes the labels print as `2a', `2b', and so
  902.      \newcount\subref
  903.      \def\eqsubreftext#1#2{%
  904.        \subref = #2           % The space stops a <number>.
  905.        \advance\subref by 96  % `a' is character code 97.
  906.        #1\char\subref
  907.      }
  908. Sadly, we must define a new count register, `\subref', instead of using
  909. the scratch count register `\count255', because `#1' might include
  910. other macro calls which use `\count255'.
  911.